Table type and hierarchy

Hello,
How can I find out if an object is a Table and then how can I query its containment (hierarchy) ?
Thanks in advance for your help.
SystemAdmin - Thu Mar 24 09:26:57 EDT 2011

Re: Table type and hierarchy
llandale - Thu Mar 24 14:10:43 EDT 2011

bool table(obj) // is a table-header object (invisible in GUI)
bool row(obj) // is a row-header object (invisible in GUI)
bool cell(obj) // is a table cell ( visible in GUI)

string number(obj) // gives the para number, looks odd for tables: 2.0-1.0-3.0-1.

Re: Table type and hierarchy
SystemAdmin - Thu Mar 24 15:24:59 EDT 2011

llandale - Thu Mar 24 14:10:43 EDT 2011
bool table(obj) // is a table-header object (invisible in GUI)
bool row(obj) // is a row-header object (invisible in GUI)
bool cell(obj) // is a table cell ( visible in GUI)

string number(obj) // gives the para number, looks odd for tables: 2.0-1.0-3.0-1.

Thanks that helped. I can now filter out the cell objects element. I'm writing a tree list view of all the objects but I'm having problems displaying the cells (tables) under their correct hierarchy because "parent object" returns the module and not the cell's parent.
Does anyone know how I could keep the table (cells) containment while displaying in a tree view?
Thank you for yout help.

Re: Table type and hierarchy
SystemAdmin - Thu Mar 24 17:10:07 EDT 2011

SystemAdmin - Thu Mar 24 15:24:59 EDT 2011
Thanks that helped. I can now filter out the cell objects element. I'm writing a tree list view of all the objects but I'm having problems displaying the cells (tables) under their correct hierarchy because "parent object" returns the module and not the cell's parent.
Does anyone know how I could keep the table (cells) containment while displaying in a tree view?
Thank you for yout help.

fyi -
I got it - I can use getTable(object) and then get its parent....

Re: Table type and hierarchy
llandale - Thu Mar 24 17:18:08 EDT 2011

SystemAdmin - Thu Mar 24 15:24:59 EDT 2011
Thanks that helped. I can now filter out the cell objects element. I'm writing a tree list view of all the objects but I'm having problems displaying the cells (tables) under their correct hierarchy because "parent object" returns the module and not the cell's parent.
Does anyone know how I could keep the table (cells) containment while displaying in a tree view?
Thank you for yout help.

Here's the hierarchy of a DOORS table with 3 rows and 2 columns.

x.-1 invisible table header object
x.-1.0-1 invisible row header object (row 1)
x.-1.0-1.0-1 visible cell, row1 column1
x.-1.0-1.0-2 visible cell, row1 column2
x.-1.0-2 invisible row header object (row 2)
x.-1.0-2.0-1 visible cell, row2 column1
x.-1.0-2.0-2 visible cell, row2 column2
x.-1.0-3 invisible row header object (row 3)
x.-1.0-3.0-1 visible cell, row3 column1
x.-1.0-3.0-2 visible cell, row3 column2

These commands make sense:
Object oRow = parent(oCell)
Object oTable1 = parent(oRow)
Object oTable2 = getTable(oCell)
indeed oTable1 == oTable2

So far, I've found no use for oRow nor oTable, other than for navigational purposes; don't see a reason to set or retrieve attr values. In the GUI if you choose not to view Tables, the Table object actually appears. Otherwise, table and row objects are ignored by the GUI.

If you get the parent(oTable) you will get some other object, which will be the preceeding object if the table was inserted "below", otherwise you'll get some previous heading. Typically its "below" the preceding text object, which is the caption for the table.

As for your post, I wonder if this is what you are looking for:

for obj in entire mod do
{  if (isDeleted(obj))                        continue
   if (table(obj) or row(obj) or cell(obj))     continue
   if (otherwise I don't want this object)  continue
   put this object info in the tree view
}


Don't think I've ever dealt with tree view, but perhaps you want to insert the table object itself, with some indicator that that's what it is (perhaps pretend its "Heading" is "Table").

 

 

  • Louie